/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.urbainski.estagio.entidade;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Cristian Elder Urbainski
 * @since 11/12/2011
 */
@Entity
@Table(name = "nota")
public class Nota implements Serializable {
   
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_nota")
    private Integer idNota;
    
    @Column(name = "id_aluno")
    private Integer idAluno;
    
    @Column(name = "id_materia")
    private Integer idMateria;
    
    @Column(name = "nr_bimestre")
    private Integer nrBimestre;
    
    @Column(name = "tp_notabimestral")
    private Integer tpNotabimestral;
    
    @Column(name = "nr_nota")
    private BigDecimal nrNota;
    
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name = "id_aluno", referencedColumnName = "id_aluno", insertable = false, updatable= false)
    private Aluno aluno;
    
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name = "id_materia", referencedColumnName = "id_materia", insertable = false, updatable= false)
    private Materia materia;

    public Aluno getAluno() {
        return aluno;
    }

    public void setAluno(Aluno aluno) {
        this.aluno = aluno;
    }

    public Integer getIdAluno() {
        return idAluno;
    }

    public void setIdAluno(Integer idAluno) {
        this.idAluno = idAluno;
    }

    public Integer getIdMateria() {
        return idMateria;
    }

    public void setIdMateria(Integer idMateria) {
        this.idMateria = idMateria;
    }

    public Integer getIdNota() {
        return idNota;
    }

    public void setIdNota(Integer idNota) {
        this.idNota = idNota;
    }

    public Materia getMateria() {
        return materia;
    }

    public void setMateria(Materia materia) {
        this.materia = materia;
    }

    public Integer getNrBimestre() {
        return nrBimestre;
    }

    public void setNrBimestre(Integer nrBimestre) {
        this.nrBimestre = nrBimestre;
    }

    public BigDecimal getNrNota() {
        return nrNota;
    }

    public void setNrNota(BigDecimal nrNota) {
        this.nrNota = nrNota;
    }

    public Integer getTpNotabimestral() {
        return tpNotabimestral;
    }

    public void setTpNotabimestral(Integer tpNotabimestral) {
        this.tpNotabimestral = tpNotabimestral;
    }
    
}